package com.woniuxy.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.woniuxy.dao.UserDao;
import com.woniuxy.entity.User;
import com.woniuxy.service.UserService;

@Service
public class UserSeviceImpl implements UserService {

	@Autowired
	UserDao userDao;

	@Override
	public User login(User user) {
		User finduser = userDao.selectUserByName(user.getUname());
		if (finduser.getUname()==null) {
			return null;
		}
		if (finduser.getUname().equals(user.getUname()) && finduser.getPassword().equals(user.getPassword())) {

			return finduser;
		} else {
			return null;
		}
	}

}
